#ifndef SCREENSHOTHELPER_H
#define SCREENSHOTHELPER_H

#include <QObject>
#include <QPixmap>
#include <QScreen>
#include <QApplication>
#include <QQuickWindow>
#include <QDateTime>
#include "src/QHotkey/qhotkey.h"
#include <QQmlApplicationEngine>

class ScreenshotHelper : public QObject
{
    Q_OBJECT
public:
    explicit ScreenshotHelper(QObject *parent = nullptr);

    Q_INVOKABLE void saveImageToClipboard(int x = 0, int y = 0, int width = -1, int height = -1);
    Q_INVOKABLE void saveImageToFile(QString filePath, QString nameFilter);
    Q_INVOKABLE void updateHotKey();
    void setEngine(QQmlApplicationEngine *ptr);
public slots:
    Q_INVOKABLE void fullScreenShot();
    Q_INVOKABLE void selectionShot();
private:
    QHotkey *fullScreenHotkey;
    QHotkey *selectionHotkey;
    QQmlApplicationEngine *engine;
    QObject *targetObject;
};

#endif // SCREENSHOTHELPER_H
